\powerman{} abstracts many different kinds of power control interfaces (IPMI, 
smart PDU, etc) into a single clean interface. \powerman{} accepts node ranges
for controlling sets of nodes, and is the default {\em resetcmd} for \conman{}
as configured by this recipe.

% begin_ohpc_run
% ohpc_validation_newline
% ohpc_command if [[ ${enable_powerman} -eq 1 ]];then
% ohpc_indent 5
% ohpc_validation_comment Optionally, install powerman
\begin{lstlisting}[language=bash,keywords={},upquote=true]
# Install powerman
[sms](*\#*) (*\install*) powerman-ohpc

# Create a basic powerman.conf
[sms](*\#*) cp /etc/powerman/powerman.conf{.example,}

[sms](*\#*) perl -pi -e 's/^\#(tcpwrappers yes)/$1/' /etc/powerman/powerman.conf
[sms](*\#*) perl -pi -e 's/^\#(listen "0.0.0.0:10101")/$1/' /etc/powerman/powerman.conf
[sms](*\#*) perl -pi -e 's/^\#(include "\/etc\/powerman\/ipmipower\.dev")/$1/' \
            /etc/powerman/powerman.conf
[sms](*\#*) for ((i=0; i<$num_computes; i++)) ; do
            perl -pi -e 'print "device \"ipmi'$i'\" \"ipmipower\" \"/usr/sbin/ipmipower -h ".
                "'${c_bmc[$i]}' -u '$bmc_username' -p ".
                "'${IPMI_PASSWORD:-undefined}'|&\"\n" if(/^\#device "ipmi1"/);' /etc/powerman/powerman.conf
        done
[sms](*\#*) for ((i=0; i<$num_computes; i++)) ; do
            perl -pi -e 'print "node \"'${c_name[$i]}'\" \"ipmi'$i'\" \"'${c_bmc[$i]}'\"\n"
                if(/^\#node "t1"/);' /etc/powerman/powerman.conf
        done

# Start powerman
[sms](*\#*) systemctl start powerman

# Check power status
[sms](*\#*) pm -q
\end{lstlisting}
% ohpc_indent 0
% ohpc_command fi
% end_ohpc_run

